/*
 * 文件名：AlarmRepairServiceImpl.java
 * 版权：Copyright by www.tiansu-china.com/
 * 描述：
 * 修改人：congriran
 * 修改时间：2020年12月17日
 * 跟踪单号：
 * 修改单号：
 * 修改内容：
*/
 
package com.tiansu.reborn.wanda.modules.executor.service.impl;

import java.sql.Timestamp;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tiansu.reborn.wanda.modules.executor.dao.AlarmRepairDao;
import com.tiansu.reborn.wanda.modules.executor.entity.AlarmDataEntity;
import com.tiansu.reborn.wanda.modules.executor.entity.AlarmTypeEntity;
import com.tiansu.reborn.wanda.modules.executor.entity.vo.AlarmRepairCondVO;
import com.tiansu.reborn.wanda.modules.executor.service.AlarmRepairService;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class AlarmRepairServiceImpl implements AlarmRepairService
{
    @Autowired
    private AlarmRepairDao alarmRepairDao;

    @Override
    public List<AlarmTypeEntity> getAlarmTypeList()
    {
        return alarmRepairDao.getAlarmTypeList();
    }

    @Override
    public List<AlarmDataEntity> queryAlarmDataList(AlarmRepairCondVO vo)
    {
        return alarmRepairDao.queryAlarmData(vo);
    }

    @Override
    public Integer repairAlarm(List<String> alarmIds)
    {
        Timestamp contenttime = new Timestamp(System.currentTimeMillis());
        int num = 0;
        for(String alarmId : alarmIds)
        {
            int result = alarmRepairDao.repairAlarmById(alarmId, 2, contenttime);
            num += result;
        }
        return num;
    }
}
